class lustre::server7 {
  #user { 'root':
  #  ensure   => 'present',
  #  password => '$5$rv.KVRN1$f3FWYGV6uGCuQ1rxY15otSUR4Yz46KsoT6CPFfX.AIA',
  #}


  case $facts['os']['release']['major'] {
  '7':{
    $lustre_pkg = [
      "bpftool",
    	"kernel",
      "kernel-debuginfo",
      "kernel-debuginfo-common-x86_64",
      "kernel-devel",
      "kernel-headers",
      "kmod-lustre",
      "kmod-lustre-osd-ldiskfs",
      #"kmod-lustre-tests",
      "libnvpair1",
      "libuutil1",
      "lustre",
      "lustre-debuginfo",
      "lustre-iokit",
      "lustre-resource-agents",
      #"lustre-tests",
      "perf",
      "perf-debuginfo",
    	"iptables-services.x86_64",
    	"device-mapper-multipath.x86_64",
    ]
    }
  /8|9/:{
    $lustre_pkg = [
     "bpftool",
     "kernel",
     "kernel-core",
     "kernel-modules",
     "kernel-debuginfo",
     "kernel-debuginfo-common-x86_64",
     "kernel-devel",
     "kernel-headers",
     "kmod-lustre",
     "kmod-lustre-osd-ldiskfs",
     #"kmod-lustre-tests",
     "libnvpair3",
     "libuutil3",
     "lustre",
     "lustre-debuginfo",
     "lustre-iokit",
     #"lustre-tests",
     "perf",
     "perf-debuginfo",
     "device-mapper-multipath.x86_64",
     ]
    }
  }  
  yumrepo {"e2fsprogs":
    baseurl   =>  "http://${mirror_server}/yum/lustre/public/e2fsprogs/latest/el${facts['os']['release']['major']}/",
    descr => "e2fsprogs",
    enabled => 1,
    gpgcheck => 0,
    priority => 10,
    before   => Yumrepo['site']
  } ->
  yumrepo {"lustre":
    baseurl   =>  "http://${mirror_server}/yum/lustre/${facts['os']['release']['full']}/server",
    descr => "lustre client",
    enabled => 1,
    gpgcheck => 0,
    priority => 10,
    before   => Yumrepo['site']
  } ->
  package { $lustre_pkg:
    ensure => installed,
  }
  sysctl { "net.ipv4.tcp_timestamps":
    ensure => present,
    value  => "1",
  }
  sysctl { "net.ipv4.tcp_sack":
    ensure => present,
    value  => "1",
  }
  sysctl { "net.ipv4.tcp_low_latency":
    ensure => present,
    value  => "0",
  }
  sysctl { "net.ipv4.tcp_window_scaling":
    ensure => present,
    value  => "1",
  }
  sysctl { "net.ipv4.tcp_moderate_rcvbuf":
    ensure => present,
    value  => "1",
  }
  sysctl { "net.core.netdev_max_backlog":
    ensure => present,
    value  => "300000",
  }
  sysctl { "net.ipv4.tcp_max_tw_buckets":
    ensure => present,
    value  => "200",
  }
  sysctl { "net.core.optmem_max":
    ensure => present,
    value  => "10485760",
  }
  sysctl { "net.core.wmem_default":
    ensure => present,
    value  => "5242880",
  }
  sysctl { "net.core.wmem_max":
    ensure => present,
    value  => "5242880",
  }
  sysctl { "net.ipv4.tcp_wmem":
    ensure => present,
    value  => "2097152  3145728  5242880",
  }
  sysctl { "net.core.rmem_default":
    ensure => present,
    value  => "8388608",
  }
  sysctl { "net.core.rmem_max":
    ensure => present,
    value  => "10485760",
  }
  sysctl { "net.ipv4.tcp_rmem":
    ensure => present,
    value  => "5242880  8388608  10485760",
  }
  sysctl { "net.ipv4.tcp_keepalive_time":
    ensure => present,
    value  => "60",
  }
  sysctl { "net.ipv4.tcp_keepalive_probes":
    ensure => present,
    value  => "3",
  }
  sysctl { "net.ipv4.tcp_keepalive_intvl":
    ensure => present,
    value  => "60",
  }
}
